﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace ReactiveLang
{
    using Util;

    partial class Expression
    {
        internal class Subject<T> : SubjectBase<IExpressionObserver<T>>, IExpressionObserver<T>, IExpression<T>
        {
            public void OnValue(T value)
            {
                ForEach(o => o.OnValue(value));
            }

            public void OnException(Exception ex)
            {
                ForEach(o => o.OnException(ex));
            }
        }
    }
}